/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test_system.questions;

/**
 *
 * @author root
 */
public class TestWrapper {

    private QuestionWrapper[] questions;

    public TestWrapper(QuestionWrapper[] questions) {
        this.questions = questions;
    }

    public int getTestLength() {
        return questions.length;
    }

    public QuestionWrapper getQuestion(int index) {
        return questions[index];
    }

    public String toString() {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < questions.length; i++) {
            sb.append(questions[i].toString());
        }
        return sb.toString();
    }

    public String toWrite() {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < questions.length; i++) {
            sb.append(questions[i].toWrite());
            sb.append(",");
        }
        return sb.toString();
    }

}
